<?php

namespace App\Http\Controllers\Api\Activity;

use App\Repository\LotteryRepository;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Http\Requests;
use LotteryService;
class LotteryController extends Controller
{
    //招新抽奖功能
    public function randomPrize(Request $request)
    {
        $prize = LotteryService::prize();

        if( ! $prize){
            $msg = '你已经参与过抽奖';
            return response()->json(compact('msg'));
        }
        
        return response()->json($prize);
    }

    //奖品列表
    public function prizeList()
    {
        $prize_list = LotteryService::prizeList();
        return response()->json($prize_list);
    }

}
